import { createRouter, createWebHashHistory } from 'vue-router'

const router = createRouter({
  history: createWebHashHistory(),
  routes: [
    {
      path: '/login',
      name: 'login',
      component: () => import('../views/Login/index.vue')
    },
    {
      path: '/',
      name: 'layout',
      component: () => import('@/views/Layout/index.vue'),
      children: [
        {
          path: 'user/list',
          component: () => import('../views/User/index.vue')
        },
        {
          path: 'swiper/list',
          component: () => import('../views/Swiper/index.vue')
        },
        {
          path: 'goods/list',
          component: () => import('../views/Goods/index.vue')
        },
        {
          path: 'echarts/show',
          component: () => import('../views/Visible/echarts.vue')
        },
        {
          path: 'echarts/other',
          component: () => import('../views/Visible/echarts-other.vue')
        },
        {
          path: 'editor/submit',
          component: () => import('../views/Editor/index.vue')
        },
        {
          path: 'map/baidu',
          component: () => import('../views/Map/baidu.vue')
        },
        {
          path: 'map/baidu-vue3',
          component: () => import('../views/Map/baidu-vue3.vue')
        },
      ]
    },
    {
      path: '/:pathMatch(.*)*',
      component: () => import('../views/NotFound/index.vue')
    }
  ]
})

export default router
